package com.web44.springboot.config;

import com.web44.springboot.listener.HelloListener;
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Title: ListenerConfig
 * @Description:
 * @Auther: py
 * @Version: 1.0
 * @create 2024/2/29 15:27
 */
@Configuration
public class ListenerConfig {

    @Bean
    public ServletListenerRegistrationBean<HelloListener> helloListenerServletListenerRegistrationBean() {
        ServletListenerRegistrationBean<HelloListener> registrationBean = new ServletListenerRegistrationBean<>();
        registrationBean.setListener(new HelloListener());
        return registrationBean;
    }
}
